package dk.itu.mobile.vo;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author niebje
 *
 */
@XmlRootElement (name = "user")
public class User implements Serializable {

	private static final long serialVersionUID = 1L;
	//implicit marshaling as XML elements
	public String name;
	public String password;
	
	public User() {
		//Empty constructor for marshalling
	}
	
	public User(String name, String password) {
		this.name = name;
		this.password = password;
	}
	
	public boolean equals(Object other) {
		if (this == other) {
			return true;
		} else if (other instanceof Task) {
			User otherTask = (User) other;
			if (this.name.equals(otherTask.name)) {
				return true;
			}
		}
		return false;
	}
	
	public String toString() {
		String value = "User: \n";
		
		value += "   name: " + name + "\n";
		value += "   password: " + password + "\n";
				
		return value;
	}
}
